<script>
export default {
	globalData: {  
		text: 'text'  ,
		//全局变量
		openid: ''
	},
	onLaunch: function() {
		console.log('App Launch');
		let that = this;
		this.$request({
			url: that.$api.app.getAppInfo,
			method: 'get',
			data: {},
		}).then(info => {
			if(info.code == 1){
				uni.setStorageSync('appInfo', info.data);
			}
		
		}).catch(error => {
			console.log(error)
		})
	},
	onShow: function() {

		console.log('App Show');
	},
	onHide: function() {
		console.log('App Hide');
	}
};

	//动态设置HTMLfontsize
    /*!(function (doc, win) {
      var cw = 750;

      function fontSizeInit() {
		var html = doc.documentElement,
		hWidth = html.getBoundingClientRect().width;
		if(IsPC()){
			hWidth = hWidth-20;
		}
		console.log(hWidth);
		hWidth > 750 && (hWidth = 750);
		hWidth < 300 && (hWidth = 300);
		html.style.fontSize = 100 * (hWidth / cw) + "px";
		console.log(html.style.fontSize)
      }
	  function IsPC() {  
	         var userAgentInfo = navigator.userAgent;  
	         var Agents = ['Android', 'iPhone',  
	             'SymbianOS', 'Windows Phone',  
	             'iPad', 'iPod'  
	         ];  
	         var flag = true;  
	         for (var i = 0; i < Agents.length; i++) {  
	             if (userAgentInfo.indexOf(Agents[i]) != -1) {  
	                 flag = false;  
	                 break;  
	             }  
	         }  
	         return flag;  
	     } 
      fontSizeInit();
      var reTimeoutId;
      win.onresize = function () {
        reTimeoutId && clearTimeout(reTimeoutId);
        reTimeoutId = setTimeout(function () {
          fontSizeInit();
        }, 100);
      };
    })(document, window);*/
</script>

<style>
/* 解决头条小程序组件内引入字体不生效的问题 */
/* #ifdef MP-TOUTIAO */
@font-face {
	font-family: uniicons;
	src: url('/static/uni.ttf');
}
/* #endif */
@import "/node_modules/uview-ui/index.scss";
</style>
